import os

# 解析的pdf图片存放路径
current_script_path = os.path.abspath(__file__)
root_path = os.path.dirname(os.path.dirname(current_script_path))
PDF_IMAGE_PATH = os.path.join(root_path, "temp")

# 达梦数据库配置
# 公司环境
DM_HOST = os.getenv('DM_HOST', '192.168.2.228')
DM_PORT = os.getenv('DM_PORT', '5236')
DM_USER = os.getenv('DM_USER', 'KB_USER')
DM_PASSWORD = os.getenv('DM_PASSWORD', 'KB@1234567890')
DM_DATABASE = os.getenv('DM_DATABASE', 'KB_DB')

# 公司Aliyun环境
# DM_HOST = os.getenv('DM_HOST', '172.21.162.168')
# DM_PORT = os.getenv('DM_PORT', 30236)
# DM_USER = os.getenv('DM_USER', 'ZHISHIKU')
# DM_PASSWORD = os.getenv('DM_PASSWORD', 'cej_zhishiku')
# DM_DATABASE = os.getenv('DM_DATABASE', 'ZHISHIKU')

# 现场环境
# DM_HOST = os.getenv('DM_HOST', '172.23.24.242')
# DM_PORT = os.getenv('DM_PORT', 5236)
# DM_USER = os.getenv('DM_USER', 'ZHISHIKU')
# DM_PASSWORD = os.getenv('DM_PASSWORD', 'cej_zhishiku')
# DM_DATABASE = os.getenv('DM_DATABASE', 'ZHISHIKU')

# OSS配置
# Aliyun
OSS_ACCESS_KEY = os.getenv('OSS_ACCESS_KEY', 'LTAI5tMvu3c2EpWvk8CeXgKd')
OSS_SECRET_KEY = os.getenv('OSS_SECRET_KEY', 'hhOV9WOPZicI6aoDhivM5RGXTGTHpA')
OSS_END_POINT = os.getenv('OSS_END_POINT', 'https://oss-cn-shanghai.aliyuncs.com')
OSS_BUCKET_NAME = os.getenv('OSS_BUCKET_NAME', 'cejdz')
OSS_REGION = os.getenv('OSS_REGION', 'cn-shanghai')
OSS_ACCESS_URL = os.getenv('OSS_ACCESS_URL', 'http://cejdz.oss-cn-shanghai.aliyuncs.com/')
OSS_BASE_PATH = 'knowledge-base/'

# 现场环境
# OSS_ACCESS_KEY = os.getenv('OSS_ACCESS_KEY', 'KmplwH7uAa2Jpu0y')
# OSS_SECRET_KEY = os.getenv('OSS_SECRET_KEY', 'kXhrbE8CWkYgJyq94czlFL5meumXoH')
# OSS_END_POINT = os.getenv('OSS_END_POINT', 'http://oss111b-cn-sx-zjsxzwy01-d01-a.inner.zjsxzwy.cn')
# OSS_BUCKET_NAME = os.getenv('OSS_BUCKET_NAME', 'yyzcfjcc-zyy-354')
# OSS_REGION = os.getenv('OSS_REGION', 'cn-shanghai')
# OSS_ACCESS_URL = os.getenv('OSS_ACCESS_URL', 'http://172.23.24.246:8986/aliyun-oss/')
# OSS_BASE_PATH = 'knowledge-base/'

# 检查人数据字典
INSPECT_PERSON_CONFIG = {
    '030b0b2fffdd0800': '姚剑锋',
    'fffef2900007faff': '石锦年',
    'fffbc3c3cbdfdbff': '无华',
    'ff77d3c10073ffff': '无根',
    'ffc591c1c19bfbff': '车新声',
}

# 巡检巡查表格分隔符
XJXC_TABLE_SEPARATOR_TITLE = [
    '变压器检查记录表',
    '柴油发电机检查记录表',
    '大闸电力专线巡查记录表',
    '附属设施维养检查表格',
    '钢结构闸门检查记录表',
    '高压配电系统检查记录表',
    '亮化系统检查记录表',
    '门式起重机月检查记录表',
    '水雨情日常检查记录表',
    '消防设施维护记录表',
    '液压启闭设备月检查记录表',
    '液压启闭设备周检查记录表',
    '油处理系统巡检表',
    '自动化控制系统检查记录表（一）',
    '自动化控制系统检查记录表（二）',
]

# 历史调度过程字典
HISTORY_SCHEDULING_FIELD_MAPPING = {
    '日期': 'scheduling_date',
    '调度次数': 'scheduling_count',
    '孔数': 'hole_count',
    '排水量(万m3)': 'displacement',
    '最大流量(m3/s)': 'max_flow',
    '时间': 'scheduling_time',
    '开启高度（m）': 'open_altitude',
    '上游水位(m)': 'upstream_water_level',
    '下游水位(m)': 'downstream_water_level',
    '水位差(m)': 'water_head',
    '单宽流量（m3）': 'single_width_flow',
    '单宽流量（m3）_2': 'single_width_flow_2'
}
# 历史调度过程解析过滤字符
HISTORY_SCHEDULING_FILTER_CHARACTER = [
    '总排水量'
]
